package com.rockcent.mall.lib.domain;

import com.rockcent.common.domain.IDEntityMall;
import com.rockcent.common.domain.enumclass.Whether;
import org.hibernate.annotations.DynamicInsert;
import org.hibernate.annotations.DynamicUpdate;

import javax.persistence.*;

/**
 * Created by marco on 2017/8/2.
 */
@Entity
@Table(name = "promotion_code")
@DynamicInsert
@DynamicUpdate
public class PromotionCode extends IDEntityMall {

    @Column(columnDefinition = "bigint comment '平台id'")
    private Long mallId;
    @Column(columnDefinition = "varchar(100) comment '名称'")
    private String name;
    @Column(columnDefinition = "varchar(1024) comment '备注'")
    private String remark;
    @Column(columnDefinition = "varchar(500) comment '二维码Url'")
    private String promoteUrl;
    @Column(columnDefinition = "varchar (20) default 'NO' comment '是否默认 (是:YES,否:NO)'")
    @Enumerated(EnumType.STRING)
    protected Whether codeDefault = Whether.NO;

    public Long getMallId() {
        return mallId;
    }

    public void setMallId(Long mallId) {
        this.mallId = mallId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

    public String getPromoteUrl() {
        return promoteUrl;
    }

    public void setPromoteUrl(String promoteUrl) {
        this.promoteUrl = promoteUrl;
    }

    public Whether getCodeDefault() {
        return codeDefault;
    }

    public void setCodeDefault(Whether codeDefault) {
        this.codeDefault = codeDefault;
    }

    @Override
    public String toString() {
        return "PromotionCode{" +
                "mallId=" + mallId +
                ", name='" + name + '\'' +
                ", codeDefault='" + codeDefault + '\'' +
                ", remark='" + remark + '\'' +
                ", promoteUrl='" + promoteUrl + '\'' +
                ", id=" + id +
                '}';
    }
}
